package org.chen.config;

import org.chen.factory.SpiderFactory;
import org.chen.pipeline.ESPNBasketballPipeline;
import org.chen.pipeline.ESPNBettingPipeline;
import org.chen.pipeline.ESPNSoccerPipeline;
import org.chen.processor.ESPNBasketBallPageProcessor;
import org.chen.processor.ESPNBettingPageProcessor;
import org.chen.processor.ESPNSoccerPageProcessor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import us.codecraft.webmagic.Spider;

@Configuration
public class CrawlerConfig {

    @Bean
    @Scope("prototype") // 确保 Spider 每次注入新实例
    public SpiderFactory spiderFactory() {
        return new SpiderFactory();
    }
}
